package com.sharemarking.wa.platform.controller;

import com.sharemarking.wa.common.ResponseParams;
import com.sharemarking.wa.platform.service.OrderManagementService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author dxy
 */
@RequestMapping("orderManagement")
@RestController
public class OrderManagementController {
    @Autowired
    OrderManagementService orderManagementService;



    /**
     * 选择地址
     *
     * @return
     * @throws Exception
     */
    @RequestMapping("chooseAddress")
    public ResponseParams<?> chooseAddress() throws Exception {
        return orderManagementService.chooseAddress();
    }

    /**
     * 接单
     *
     * @return
     * @throws Exception
     */
    @RequestMapping("accept")
    public ResponseParams<?> accept() throws Exception {
        return orderManagementService.accept();
    }


    /**
     * 完成订单
     *
     * @return
     * @throws Exception
     */
    @RequestMapping("finishOrder")
    public ResponseParams<?> finishOrder() throws Exception {
        return orderManagementService.finishOrder();
    }

    /**
     * 取消接单
     *
     * @return
     * @throws Exception
     */
    @RequestMapping("cancelAcceptOrder")
    public ResponseParams<?> cancelAcceptOrder() throws Exception {
        return orderManagementService.cancelAcceptOrder();
    }
}
